package laya.semi.process;

import java.util.*;
import java.text.*;

import org.apache.log4j.Logger;

public class ArrayIteratorInitialActivity
	implements IGenericClassActivity
{
	private static Logger log = Logger.getLogger(ArrayIteratorInitialActivity.class);

	public void execute(IProcessContext oCtx)
		throws Exception
	{
		String[] vParam = oCtx.getActivityParameter().split(":");
		String oIteratorField = vParam[0];
		String[] vField = vParam[1].split(",");
		
		ArrayIterator it = new ArrayIterator();
		
		for (int i = 0; i < vField.length; ++i)
		{
			it.addField(vField[i], (Object[])oCtx.getField(vField[i]));
		}
		
		oCtx.setField(oIteratorField, it);
	}
}
